package com.android.butterknife;

import org.eclipse.jdt.annotation.Nullable;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnItemClick;
import butterknife.OnItemLongClick;
import butterknife.OnItemSelected;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;

public class ListViewActivity extends Activity {
	@Bind(R.id.listview)
	ListView mListView;
	private ListDataAdapter mAdapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_listview);
		ButterKnife.bind(this);

		mAdapter = new ListDataAdapter(this);
		mListView.setAdapter(mAdapter);
	}

	@Nullable
	@OnItemSelected(R.id.listview)
	void OnListItemSelected(int position) {
		Log.e("ListViewActivity", "ListView --- OnListItemSelected:" + position);
	}

	@Nullable
	@OnItemClick(R.id.listview)
	void onListItemClick(int position) {
		Log.e("ListViewActivity", "ListView --- onListItemClick:" + position);
	}

	@Nullable
	@OnItemLongClick(R.id.listview)
	boolean onListItemLongClick(int position) {
		Log.e("ListViewActivity", "ListView --- onListItemLongClick:"
				+ position);
		return true;
	}

}
